package cn.iocoder.yudao.module.jikong.dal.mysql.user;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.jikong.dal.dataobject.jkProductType.JkProductTypeDO;
import cn.iocoder.yudao.module.jikong.dal.dataobject.user.JkUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.jikong.controller.admin.user.vo.*;

/**
 * 用户 Mapper
 *
 * @author xc
 */
@Mapper
public interface JkUserMapper extends BaseMapperX<JkUserDO> {

    default PageResult<JkUserDO> selectPage(UserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<JkUserDO>()
                .betweenIfPresent(JkUserDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(JkUserDO::getPassTime, reqVO.getPassTime())
                .likeIfPresent(JkUserDO::getName, reqVO.getName())
                .eqIfPresent(JkUserDO::getMobile, reqVO.getMobile())
                .eqIfPresent(JkUserDO::getUserType, reqVO.getUserType())
                .likeIfPresent(JkUserDO::getRealName, reqVO.getRealName())
                .eqIfPresent(JkUserDO::getStatus, reqVO.getStatus())
                .eqIfPresent(JkUserDO::getBlacklistStatus, reqVO.getBlacklistStatus())
                .eqIfPresent(JkUserDO::getReviewStatus, reqVO.getReviewStatus())
                .orderByDesc(JkUserDO::getId));
    }

}
